package com.wmh.baseservice.merchant.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author wmh generator
 * @since 2022-09-07
 */
@ApiModel(value="MerchantGroupGoods对象", description="商家团购商品表")
public class MerchantGroupGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "状态:	0拼团中 -1已下架")
    private Integer status;

    @ApiModelProperty(value = "备注0未结算 1当天已结算")
    private String remark;

    @ApiModelProperty(value = "版本号")
    @Version
    private Integer version;

    private Date createTime;

    private Date updateTime;

    @ApiModelProperty(value = "商家id")
    private Long merchantId;

    @ApiModelProperty(value = "团购标题")
    private String title;

    @ApiModelProperty(value = "轮播图")
    private String img;

    @ApiModelProperty(value = "主图")
    private String avatar;

    @ApiModelProperty(value = "原价")
    private BigDecimal originalPrice;

    @ApiModelProperty(value = "简介")
    private String overview;

    @ApiModelProperty(value = "商品详情")
    private String content;

    @ApiModelProperty(value = "销量")
    private Integer sale;


    @ApiModelProperty(value = "视频")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String video;

    @ApiModelProperty(value = "库存")
    private Integer inventory;

    @ApiModelProperty(value = "分类id")
    private Long categoryId;

    @ApiModelProperty(value = "路径id")
    private Long urlId;

    @ApiModelProperty(value = "1有 -1无")
    private Integer hasSpec;

    @ApiModelProperty(value = "开始时间")
    private String startTime;

    @ApiModelProperty(value = "结束时间")
    private String endTime;

    @ApiModelProperty(value = "运费模板id")
    private Long freightId;

    @ApiModelProperty(value = "单位/（件斤盒个）")
    private String unit;

    @ApiModelProperty(value = "可选购买重量/数量")
    private String buyUnit;

    @ApiModelProperty(value = "0自提 1快递 2均支持 3支持配送")
    private Integer type;

    @ApiModelProperty(value = "自提地址")
    private String selfMentionAddress;

    @ApiModelProperty(value = "是否包邮1包邮 -1不包邮")
    private Integer hasFreeShipp;

    @ApiModelProperty(value = "是否区域限制1有 -1没有")
    private Integer hasAreaLimit;

    @ApiModelProperty(value = "档位和区域id快照")
    private String snapshot;

    @ApiModelProperty(value = "批号 1000开始，每次团拼开始都+1，用户下订单的时候也带上批号，用以确认是同一批")
    private Integer batchNum;

    @ApiModelProperty(value = "经纬度，逗号分割")
    private String latLng;

    @ApiModelProperty(value = "单笔推广佣金")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal commission;

    @ApiModelProperty(value = "支持配送的区域id")
    private String locationIds;

    @ApiModelProperty(value = "团购是否自动上架")
    private Integer isAutoShelving;

    @ApiModelProperty(value = "团购续期时间(单位 / 小时)")
    private Integer autoShelvingTime;

    public Long getId() {
        return id;
    }

    public MerchantGroupGoods setId(Long id) {
        this.id = id;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public MerchantGroupGoods setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public String getRemark() {
        return remark;
    }

    public MerchantGroupGoods setRemark(String remark) {
        this.remark = remark;
        return this;
    }
    public Integer getVersion() {
        return version;
    }

    public MerchantGroupGoods setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public MerchantGroupGoods setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public MerchantGroupGoods setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public Long getMerchantId() {
        return merchantId;
    }

    public MerchantGroupGoods setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
        return this;
    }
    public String getTitle() {
        return title;
    }

    public MerchantGroupGoods setTitle(String title) {
        this.title = title;
        return this;
    }
    public String getImg() {
        return img;
    }

    public MerchantGroupGoods setImg(String img) {
        this.img = img;
        return this;
    }
    public String getAvatar() {
        return avatar;
    }

    public MerchantGroupGoods setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }
    public BigDecimal getOriginalPrice() {
        return originalPrice;
    }

    public MerchantGroupGoods setOriginalPrice(BigDecimal originalPrice) {
        this.originalPrice = originalPrice;
        return this;
    }
    public String getOverview() {
        return overview;
    }

    public MerchantGroupGoods setOverview(String overview) {
        this.overview = overview;
        return this;
    }
    public String getContent() {
        return content;
    }

    public MerchantGroupGoods setContent(String content) {
        this.content = content;
        return this;
    }
    public Integer getSale() {
        return sale;
    }

    public MerchantGroupGoods setSale(Integer sale) {
        this.sale = sale;
        return this;
    }
    public String getVideo() {
        return video;
    }

    public MerchantGroupGoods setVideo(String video) {
        this.video = video;
        return this;
    }
    public Integer getInventory() {
        return inventory;
    }

    public MerchantGroupGoods setInventory(Integer inventory) {
        this.inventory = inventory;
        return this;
    }
    public Long getCategoryId() {
        return categoryId;
    }

    public MerchantGroupGoods setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
        return this;
    }
    public Long getUrlId() {
        return urlId;
    }

    public MerchantGroupGoods setUrlId(Long urlId) {
        this.urlId = urlId;
        return this;
    }
    public Integer getHasSpec() {
        return hasSpec;
    }

    public MerchantGroupGoods setHasSpec(Integer hasSpec) {
        this.hasSpec = hasSpec;
        return this;
    }
    public String getStartTime() {
        return startTime;
    }

    public MerchantGroupGoods setStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }
    public String getEndTime() {
        return endTime;
    }

    public MerchantGroupGoods setEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }
    public Long getFreightId() {
        return freightId;
    }

    public MerchantGroupGoods setFreightId(Long freightId) {
        this.freightId = freightId;
        return this;
    }
    public String getUnit() {
        return unit;
    }

    public MerchantGroupGoods setUnit(String unit) {
        this.unit = unit;
        return this;
    }
    public String getBuyUnit() {
        return buyUnit;
    }

    public MerchantGroupGoods setBuyUnit(String buyUnit) {
        this.buyUnit = buyUnit;
        return this;
    }
    public Integer getType() {
        return type;
    }

    public MerchantGroupGoods setType(Integer type) {
        this.type = type;
        return this;
    }
    public String getSelfMentionAddress() {
        return selfMentionAddress;
    }

    public MerchantGroupGoods setSelfMentionAddress(String selfMentionAddress) {
        this.selfMentionAddress = selfMentionAddress;
        return this;
    }

    public Integer getHasFreeShipp() {
        return hasFreeShipp;
    }

    public MerchantGroupGoods setHasFreeShipp(Integer hasFreeShipp) {
        this.hasFreeShipp = hasFreeShipp;
        return this;
    }
    public Integer getHasAreaLimit() {
        return hasAreaLimit;
    }

    public MerchantGroupGoods setHasAreaLimit(Integer hasAreaLimit) {
        this.hasAreaLimit = hasAreaLimit;
        return this;
    }
    public String getSnapshot() {
        return snapshot;
    }

    public MerchantGroupGoods setSnapshot(String snapshot) {
        this.snapshot = snapshot;
        return this;
    }
    public Integer getBatchNum() {
        return batchNum;
    }

    public MerchantGroupGoods setBatchNum(Integer batchNum) {
        this.batchNum = batchNum;
        return this;
    }
    public String getLatLng() {
        return latLng;
    }

    public MerchantGroupGoods setLatLng(String latLng) {
        this.latLng = latLng;
        return this;
    }
    public BigDecimal getCommission() {
        return commission;
    }

    public MerchantGroupGoods setCommission(BigDecimal commission) {
        this.commission = commission;
        return this;
    }

    public String getLocationIds() {
        return locationIds;
    }

    public MerchantGroupGoods setLocationIds(String locationIds) {
        this.locationIds = locationIds;
        return this;
    }

    public Integer getIsAutoShelving() {
        return isAutoShelving;
    }

    public MerchantGroupGoods setIsAutoShelving(Integer isAutoShelving) {
        this.isAutoShelving = isAutoShelving;
        return this;
    }

    public Integer getAutoShelvingTime() {
        return autoShelvingTime;
    }

    public MerchantGroupGoods setAutoShelvingTime(Integer AutoShelvingTime) {
        this.autoShelvingTime = AutoShelvingTime;
        return this;
    }

    public static final String ID = "id";

    public static final String STATUS = "status";

    public static final String REMARK = "remark";

    public static final String VERSION = "version";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String MERCHANT_ID = "merchant_id";

    public static final String TITLE = "title";

    public static final String IMG = "img";

    public static final String AVATAR = "avatar";

    public static final String ORIGINAL_PRICE = "original_price";

    public static final String OVERVIEW = "overview";

    public static final String CONTENT = "content";

    public static final String SALE = "sale";

    public static final String VIDEO = "video";

    public static final String INVENTORY = "inventory";

    public static final String CATEGORY_ID = "category_id";

    public static final String URL_ID = "url_id";

    public static final String HAS_SPEC = "has_spec";

    public static final String START_TIME = "start_time";

    public static final String END_TIME = "end_time";

    public static final String FREIGHT_ID = "freight_id";

    public static final String UNIT = "unit";

    public static final String BUY_UNIT = "buy_unit";

    public static final String TYPE = "type";

    public static final String SELF_MENTION_ADDRESS = "self_mention_address";

    public static final String HAS_FREE_SHIPP = "has_free_shipp";

    public static final String HAS_AREA_LIMIT = "has_area_limit";

    public static final String SNAPSHOT = "snapshot";

    public static final String BATCH_NUM = "batch_num";

    public static final String LAT_LNG = "lat_lng";

    public static final String COMMISSION = "commission";

    public static final String LOCATION_IDS = "location_ids";

    public static final String IS_AUTO_SHELVING = "is_auto_shelving";

    public static final String AUTO_SHELVING_TIME = "auto_shelving_time";

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            MerchantGroupGoods.ID
            ,MerchantGroupGoods.STATUS
            ,MerchantGroupGoods.REMARK
            ,MerchantGroupGoods.VERSION
            ,MerchantGroupGoods.CREATE_TIME
            ,MerchantGroupGoods.UPDATE_TIME
            ,MerchantGroupGoods.MERCHANT_ID
            ,MerchantGroupGoods.TITLE
            ,MerchantGroupGoods.IMG
            ,MerchantGroupGoods.AVATAR
            ,MerchantGroupGoods.ORIGINAL_PRICE
            ,MerchantGroupGoods.OVERVIEW
            ,MerchantGroupGoods.CONTENT
            ,MerchantGroupGoods.SALE
            ,MerchantGroupGoods.VIDEO
            ,MerchantGroupGoods.INVENTORY
            ,MerchantGroupGoods.CATEGORY_ID
            ,MerchantGroupGoods.URL_ID
            ,MerchantGroupGoods.HAS_SPEC
            ,MerchantGroupGoods.START_TIME
            ,MerchantGroupGoods.END_TIME
            ,MerchantGroupGoods.FREIGHT_ID
            ,MerchantGroupGoods.UNIT
            ,MerchantGroupGoods.BUY_UNIT
            ,MerchantGroupGoods.TYPE
            ,MerchantGroupGoods.SELF_MENTION_ADDRESS
            ,MerchantGroupGoods.HAS_FREE_SHIPP
            ,MerchantGroupGoods.HAS_AREA_LIMIT
            ,MerchantGroupGoods.SNAPSHOT
            ,MerchantGroupGoods.BATCH_NUM
            ,MerchantGroupGoods.LAT_LNG
            ,MerchantGroupGoods.COMMISSION
            ,MerchantGroupGoods.IS_AUTO_SHELVING
            ,MerchantGroupGoods.AUTO_SHELVING_TIME
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }

    @Override
    public String toString() {
        return "MerchantGroupGoods{" +
                "id=" + id +
                ", status=" + status +
                ", remark='" + remark + '\'' +
                ", version=" + version +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", merchantId=" + merchantId +
                ", title='" + title + '\'' +
                ", img='" + img + '\'' +
                ", avatar='" + avatar + '\'' +
                ", originalPrice=" + originalPrice +
                ", overview='" + overview + '\'' +
                ", content='" + content + '\'' +
                ", sale=" + sale +
                ", video='" + video + '\'' +
                ", inventory=" + inventory +
                ", categoryId=" + categoryId +
                ", urlId=" + urlId +
                ", hasSpec=" + hasSpec +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", freightId=" + freightId +
                ", unit='" + unit + '\'' +
                ", buyUnit='" + buyUnit + '\'' +
                ", type=" + type +
                ", selfMentionAddress='" + selfMentionAddress + '\'' +
                ", hasFreeShipp=" + hasFreeShipp +
                ", hasAreaLimit=" + hasAreaLimit +
                ", snapshot='" + snapshot + '\'' +
                ", batchNum=" + batchNum +
                ", latLng='" + latLng + '\'' +
                ", commission=" + commission +
                ", locationIds='" + locationIds + '\'' +
                ", isAutoShelving=" + isAutoShelving +
                ", autoShelvingTime=" + autoShelvingTime +
                '}';
    }
}